﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiShellFaceIterator : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiShellFaceIterator(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiShellFaceIterator obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiShellFaceIterator()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiShellFaceIterator(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGiShellFaceIterator() : this(GlobalsPINVOKE.new_OdGiShellFaceIterator__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiShellFaceIterator(OdGePoint3d points, SWIGTYPE_p_OdInt32 faceList) : this(GlobalsPINVOKE.new_OdGiShellFaceIterator__SWIG_1(OdGePoint3d.getCPtr(points), SWIGTYPE_p_OdInt32.getCPtr(faceList)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void set(OdGePoint3d points, SWIGTYPE_p_OdInt32 faceList)
		{
			GlobalsPINVOKE.OdGiShellFaceIterator_set(this.swigCPtr, OdGePoint3d.getCPtr(points), SWIGTYPE_p_OdInt32.getCPtr(faceList));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int[] faceListPos()
		{
			int[] result = Helpers.UnMarshalInt32FixedArray(GlobalsPINVOKE.OdGiShellFaceIterator_faceListPos(this.swigCPtr));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d __ref__()
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiShellFaceIterator___ref__(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d __deref__()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGiShellFaceIterator___deref__(this.swigCPtr);
			OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiShellFaceIterator Add(int n)
		{
			OdGiShellFaceIterator result = new OdGiShellFaceIterator(GlobalsPINVOKE.OdGiShellFaceIterator_Add(this.swigCPtr, n), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiShellFaceIterator Sub(int n)
		{
			OdGiShellFaceIterator result = new OdGiShellFaceIterator(GlobalsPINVOKE.OdGiShellFaceIterator_Sub__SWIG_0(this.swigCPtr, n), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d kOrigin
		{
			get
			{
				IntPtr intPtr = GlobalsPINVOKE.OdGiShellFaceIterator_kOrigin_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		public OdGePoint2d convert2d(OdGePlanarEnt plane)
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGiShellFaceIterator_convert2d__SWIG_0(this.swigCPtr, OdGePlanarEnt.getCPtr(plane)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint2d convert2d()
		{
			OdGePoint2d result = new OdGePoint2d(GlobalsPINVOKE.OdGiShellFaceIterator_convert2d__SWIG_1(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d Mul(double scale)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiShellFaceIterator_Mul__SWIG_0(this.swigCPtr, scale), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d Div(double scale)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiShellFaceIterator_Div__SWIG_0(this.swigCPtr, scale), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d Add(OdGeVector3d vect)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiShellFaceIterator_Add__SWIG_0(this.swigCPtr, OdGeVector3d.getCPtr(vect)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeVector3d asVector()
		{
			OdGeVector3d result = new OdGeVector3d(GlobalsPINVOKE.OdGiShellFaceIterator_asVector(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double distanceTo(OdGePoint3d point)
		{
			double result = GlobalsPINVOKE.OdGiShellFaceIterator_distanceTo(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d project(OdGePlane plane, OdGeVector3d vect)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiShellFaceIterator_project(this.swigCPtr, OdGePlane.getCPtr(plane), OdGeVector3d.getCPtr(vect)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d orthoProject(OdGePlane plane)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGiShellFaceIterator_orthoProject(this.swigCPtr, OdGePlane.getCPtr(plane)), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsEqual(OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGiShellFaceIterator_IsEqual(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool IsNotEqual(OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGiShellFaceIterator_IsNotEqual(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualTo(OdGePoint3d point, OdGeTol tol)
		{
			bool result = GlobalsPINVOKE.OdGiShellFaceIterator_isEqualTo__SWIG_0(this.swigCPtr, OdGePoint3d.getCPtr(point), OdGeTol.getCPtr(tol));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isEqualTo(OdGePoint3d point)
		{
			bool result = GlobalsPINVOKE.OdGiShellFaceIterator_isEqualTo__SWIG_1(this.swigCPtr, OdGePoint3d.getCPtr(point));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double GetItem(uint i)
		{
			double result = GlobalsPINVOKE.OdGiShellFaceIterator_GetItem__SWIG_0(this.swigCPtr, i);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double x
		{
			get
			{
				double result = GlobalsPINVOKE.OdGiShellFaceIterator_x_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		public double y
		{
			get
			{
				double result = GlobalsPINVOKE.OdGiShellFaceIterator_y_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		public double z
		{
			get
			{
				double result = GlobalsPINVOKE.OdGiShellFaceIterator_z_get(this.swigCPtr);
				if (GlobalsPINVOKE.SWIGPendingException.Pending)
				{
					throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
